/*    */ package com.zimbra.cs.pop3;
/*    */ 
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.security.sasl.Authenticator;
/*    */ import com.zimbra.cs.security.sasl.AuthenticatorUser;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ class Pop3AuthenticatorUser
/*    */   implements AuthenticatorUser
/*    */ {
/*    */   private final Pop3Handler mHandler;
/*    */   
/*    */   Pop3AuthenticatorUser(Pop3Handler handler)
/*    */   {
/* 31 */     this.mHandler = handler;
/*    */   }
/*    */   
/*    */   public String getProtocol() {
/* 35 */     return "pop";
/*    */   }
/*    */   
/*    */   public void sendBadRequest(String s) throws IOException {
/* 39 */     this.mHandler.sendERR(s);
/*    */   }
/*    */   
/*    */   public void sendFailed() throws IOException
/*    */   {
/* 44 */     this.mHandler.sendERR("authentication failed");
/*    */   }
/*    */   
/*    */   public void sendFailed(String msg) throws IOException
/*    */   {
/* 49 */     this.mHandler.sendERR("authentication failed: " + msg);
/*    */   }
/*    */   
/*    */   public void sendSuccessful() throws IOException
/*    */   {
/* 54 */     this.mHandler.sendOK("authentication successful");
/*    */   }
/*    */   
/*    */   public void sendContinuation(String s) throws IOException
/*    */   {
/* 59 */     this.mHandler.sendContinuation(s);
/*    */   }
/*    */   
/*    */   public boolean authenticate(String authorizationId, String authenticationId, String password, Authenticator auth) throws IOException
/*    */   {
/*    */     try
/*    */     {
/* 66 */       this.mHandler.authenticate(authorizationId, authenticationId, password, auth);
/*    */     } catch (Pop3CmdException e) {
/* 68 */       auth.sendFailed(e.getMessage());
/* 69 */       return false;
/*    */     }
/* 71 */     return true;
/*    */   }
/*    */   
/*    */   public Log getLog()
/*    */   {
/* 76 */     return ZimbraLog.pop;
/*    */   }
/*    */   
/*    */   public boolean isSSLEnabled()
/*    */   {
/* 81 */     return this.mHandler.isSSLEnabled();
/*    */   }
/*    */   
/*    */   public boolean allowCleartextLogin()
/*    */   {
/* 86 */     return this.mHandler.config.isCleartextLoginsEnabled();
/*    */   }
/*    */   
/*    */   public boolean isGssapiAvailable()
/*    */   {
/* 91 */     return this.mHandler.config.isSaslGssapiEnabled();
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/pop3/Pop3AuthenticatorUser.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */